package br.uvv.Model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="ti_ator")
public class Ator extends EntidadeGenerica {

	private static final long serialVersionUID = 1553293126169812159L;
	
	@Column(length=128, nullable=false)
	private String nome;
	
	@ManyToOne(fetch=FetchType.LAZY, optional=false)
	private ClientePortal cliente;
	
	@ManyToMany(fetch=FetchType.LAZY)
	@JoinTable(name="ti_ator_descricao", 
		joinColumns=@JoinColumn(name="ator_id"),
		inverseJoinColumns=@JoinColumn(name="descricao_id"))
	private List<DescricaoEstendida> descricoes;
	
	@Override
	public String toJson() {
		return null;
	}
	
	public String getNome() {
		return nome;
	}
	
	public void setNome(String nome) {
		this.nome = nome;
	}
	
	public ClientePortal getCliente() {
		return cliente;
	}
	
	public void setCliente(ClientePortal cliente) {
		this.cliente = cliente;
	}
	
	public List<DescricaoEstendida> getDescricoes() {
		return descricoes;
	}
	
	public void setDescricoes(List<DescricaoEstendida> descricoes) {
		this.descricoes = descricoes;
	}
}